import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import HomePage from '@/Pages/HomePage.vue'
import UserLoginPage from '@/Pages/UserLoginPage.vue'
import UserRegisterPage from '@/Pages/UserRegisterPage.vue'
import UserManagePage from '@/Pages/UserManagePage.vue'
import AddLeavePage from '@/Pages/AddLeavePage.vue'
import LeaveInfoManagePage from '@/Pages/LeaveInfoManagePage.vue'
import ProgressQueryPage from '@/Pages/ProgressQueryPage.vue'
import AboutPageVue from '@/Pages/AboutPage.vue'
import ScoreManagePage from '@/Pages/ScoreManagePage.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomePage,
    },
    {
      path: '/user/login',
      name: '用户登录',
      component: UserLoginPage,
    },
    {
      path: '/user/register',
      name: '用户注册',
      component: UserRegisterPage,
    },
    {
      path: '/admin/userManage',
      name: '用户管理',
      component: UserManagePage,
    },
    {
      path: '/admin/leaveInfoManage',
      name: '请假管理',
      component: LeaveInfoManagePage,
    },
    {
      path: '/admin/scoreManage',
      name: '分数管理',
      component: ScoreManagePage,
    },
    {
      path: '/user/addLeavePage',
      name: '请假表',
      component: AddLeavePage ,
    },
    {
      path: '/user/progressQuery',
      name: '进度查询',
      component: ProgressQueryPage ,
    },
    {
      path: '/about',
      name: '关于',
      component: AboutPageVue,
    },
    {
      path: '/h',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
  ],
})

export default router
